<?php
//require_once('./Sort.class.php');   一维数组
require_once('./sort.php');  //二维数组的用法
//按首字母排序
$data = [
['id' => 1, 'area_name' => '皎月'],
['id' => 2, 'area_name' => '殇月'],
['id' => 3, 'area_name' => '机动'],
['id' => 4, 'area_name' => '福建'],
['id' => 5, 'area_name' => '江西'],
['id' => 6, 'area_name' => '广东'],
['id' => 7, 'area_name' => '广西'],
['id' => 8, 'area_name' => '海南'],
['id' => 9, 'area_name' => '河南'],
['id' => 10, 'area_name' => '湖南'],
['id' => 11, 'area_name' => '湖北'],
];


// 初始化，然后调用分组方法
$obj = new Character();
$sort_data = $obj->groupByInitials($data,'area_name');
var_dump($sort_data);

//一维数组的用法
// $username = ['皎月','殇月','机动','福建'];
// $obj = new Sort();
// $data = $obj->addPeople($username);
// var_dump($data);